import Link from 'next/link';
import { withRouter } from 'next/router';
// 下拉菜单
import Dropdown from './Dropdown';

const Nav = ({ router }) => {
    return (
        <nav className="nav">
            <div className="max-content">
                <div className={`destination ${router.pathname === '/' ? 'dropdown' : ''}`}>
                    热门目的地 { router.pathname !== '/' ? <span className="iconfont icon-xiajiantou"></span> : '' }
                    <Dropdown />
                </div>
                <ul className="nav-bar">
                    <li><Link href="/"><a>首页</a></Link></li>
                    <li><Link href="/ticket"><a>景点门票</a></Link></li>
                    <li><Link href="/hotel"><a>酒店住宿</a></Link></li>
                    <li><Link href="/line"><a>线路预订</a></Link></li>
                    <li><Link href="/car"><a>用车包车</a></Link></li>
                    <li><Link href="/guide" prefetch={false}><a>旅游攻略</a></Link></li>
                    <li><Link href="/custom_tour" prefetch={false}><a>定制游</a></Link></li>
                </ul>
            </div>
        </nav>
    )
}

export default withRouter(Nav)